package com.gang.crm.bean;

public class TestSort {
	
	public static void main(String[] args) {
		
		TestSort testSort = new TestSort();
		/*int[] nums = new int[] {
				1,23,11,5,8,14,9,7,18
		};
		testSort.insert(nums);*/
		
		String str = "2,";
		String[] array = str.split(",");
		System.out.println(array);
		
	}
	
	private void test(String name) {
		name = "jiayou";
	}

	private void bubble(int[] array) {
		
		int temp = 0;
		for(int i = 0; i < array.length - 1; i++) {
			
			for(int j = 0; j < array.length - 1 - i; j++) {
				
				if(array[j] > array[j + 1]) {
					
					temp = array[j];
					array[j] = array[j + 1];
					array[j + 1] = temp;
				}
			}
		}
		
	}
	
	private void choice(int[] array) {
		
		int x = 0;
		int temp = 0;
		for(int i = 0; i < array.length - 1; i++) {
			x = i;
			for(int j = i + 1; j < array.length; j++) {
				
				if(array[x] > array[j]) {
					x = j;
				}
			}
			temp = array[i];
			array[i] = array[x];
			array[x] = temp;
		}
	}
	
	private void insert(int[] array) {
		
		int j = 0;
		int temp = 0;
	 	for(int i = 1; i < array.length; i++) {
	 		j = i - 1;
	 		temp = array[i];
	 		while(j >= 0 && (array[j] > temp)) {
	 			array[j+1] = array[j];
	 			j--;
	 		}
	 		
	 		array[j + 1] = temp;
	 	}
	 	
	}
}
